package com.study.designpattern.strategy;

/**
 * <p>封装角色</p>
 *
 * @author chentao
 * @version v 0.1 2022/9/9 14:09
 */
public class Context {
    //抽象策略
    private Strategy strategy = null;

    //设置具体的策略
    public Context(Strategy strategy) {
        this.strategy = strategy;
    }

    //封装后的策略方法
    public void doAnything() {
        this.strategy.doSomething();
    }

}
